﻿<button @onclick="IncreaseCount">Click to count</button>
<p>@Count</p>

@code {
    public int Count { get; private set; } = 0;
    void IncreaseCount() => Count++;
}